﻿@using GoodMan.Infrastructure.Entities.Entity;
@{
    Layout = "/Views/Shared/_Main.cshtml";
    Integration integration = ViewBag.Integration;
}
<br />
<div class="row-fluid">
    <div class="span3">
        <div class="border-gray bg-gray">
            <ul class="nav nav-list">
                <li class="nav-header">用户管理</li>
                <!--active-->
                <li class="active"><a href="/usercenter/index">管理首页</a></li>
                <li class=""><a href="/usercenter/order">我的订单</a></li>
                <li class=""><a href="/usercenter/info">个人资料</a></li>
                <li class=""><a href="/usercenter/mypwd">修改密码</a></li>
            </ul>
        </div>
    </div>
    <div class="span9 border-gray">
        <ul class="breadcrumb">
            <li><a href="user-center.html">管理首页</a> <span class="divider">/</span></li>
            <li class="active">申请退款</li>
        </ul>
        <br />
        <!--购物车preview-->
        <div class="">
            <!--表单-->
            <form id="refundform" method="post" action="/usercenter/refund" class="form-horizontal">
            <div class="control-group">
                <label class="control-label">
                    帐户余额</label>
                <div class="controls">
                    <label class="red text-large">
                        @if (integration == null)
                        {
                            @:0.00    
                        }
                        else { 
                            @integration.Balance
                        }
                    </label>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="total">
                    退款金额</label>
                <div class="controls">
                    <input type="text" id="total" name="refund" value="0.00" class="span4 {messages:{number:'输入有误',min:'必须大于0',max:'余额不足'},required:true,number:true,min:0.01,max:@(integration.Balance)}" placeholder="退款金额" />
                    <span>（元）</span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="password">
                    登录密码</label>
                <div class="controls">
                    <input type="password" id="password" name="password" class="{required:true}" placeholder="登录密码" />
                </div>
            </div>
            <div class="control-group">
                <div class="controls">
                    <br />
                    <button type="submit" class="btn btn-danger">
                        <i class="icon-ok icon-white"></i>&nbsp;申请退款
                    </button>
                </div>
            </div>
            </form>
            <!--#表单-->
        </div>
        <!--#购物车preview-->
    </div>
</div>
@section tail{
    <script type="text/javascript" src="/Scripts/jquery.validate.js"></script>
    <script type="text/javascript" src="/Scripts/jquery.metadata.js"></script>
    <script type="text/javascript">
     $(function () {
            $('#refundform').validate({
                errorClass: "help-inline",
                errorElement: "span",
                highlight: function (element, errorClass, validClass) {
                    $(element).parents('.control-group').addClass('error');
                },
                unhighlight: function (element, errorClass, validClass) {
                    $(element).parents('.control-group').removeClass('error');
                }
            });
        });
    </script>
}